<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>公司详情</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="style/weui.css">
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        body {
            font-size: 14px;
            background:#fff;
        }
        header {
            height: 50px;
            line-height: 50px;
            padding-left: 15px;
            font-size: 16px;
        }
        nav {
            width: 100%;
            overflow: hidden;
            height: 51px;
            line-height: 50px;
            background: #fff;
            font-size: 16px;
        }
        ul {list-style: none;}
        ul li {
            float: left;
            width: 33.33%;
            text-align: center;
            cursor: pointer;
        }
        ul li.active {
            border-bottom: 1px solid blue;
        }
        .con {
            width: 100%;
            height: 100%;
        }
        .gray {
            width: 100%;
            height: 10px;
            background: gray;
        }
    </style>
</head>
<body>
    <div class="wrap">
        <header>四川长虹建设工程有限公司</header>
        <div class="gray"></div>
        <nav id="details-nav">
            <ul>
                <li class="active" data-cat="JJ">简介</li>
                <li data-cat="JY">经营</li>
                <li data-cat="ZZ">资质<li>
            </ul>
        </nav>
        <div id="details-con" class="con">
            简介
        </div>
    </div>
     <script src="./libs/zepto.min.js"></script>
    <script>
        $("#details-nav").on('tap', function(e) {
            var dataCat = e.target.getAttribute('data-cat');
            e.target.className = 'active';
            $(e.target).siblings().removeClass('active');
            // e.target.nextSibling.setAttribute('class', '');
            if (e.target.nodeName == 'LI') {
                if (dataCat == 'JJ') {
                    $("#details-con").html('简介');

                } else if (dataCat == 'JY') {
                    $("#details-con").html('经营');
                } else if (dataCat == 'ZZ') {
                    $("#details-con").html('资质');   
                }
            }
        });
    </script>
</body>
</html>